xen.git
14 years agolibxl: plumb libxl_domain_config down into device model creation.
Ian Campbell [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: plumb libxl_domain_config down into device model creation.

Creating the device model derives lots of bits from the guest configuration.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: define libxl_sdl_info to hold all info about the SDL config
Ian Campbell [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: define libxl_sdl_info to hold all info about the SDL config

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: define libxl_spice_info to hold all info about the spice server
Ian Campbell [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: define libxl_spice_info to hold all info about the spice server

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: define libxl_vnc_info to hold all info about the vnc info
Ian Campbell [Tue, 31 Jan 2012 14:40:59 +0000 (14:40 +0000)]
libxl: define libxl_vnc_info to hold all info about the vnc info

Reduces duplication in libxl_vfb and libxl_device_model.

Updated bindings but the python ones in particular are unlikely to be useful
until a user presents itself and fixes them up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoocaml: use libxl IDL type helpers for C argument passing
Ian Campbell [Tue, 31 Jan 2012 14:40:08 +0000 (14:40 +0000)]
ocaml: use libxl IDL type helpers for C argument passing

Makes handling of nested structs more correct.

Only change to the generated code right now is that the FOO_Val
(C->ocamlC) function for Enumeration types now takes the C argument by
value instead of reference.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: use keyword arguments for field definitions in aggregate types.
Ian Campbell [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: use keyword arguments for field definitions in aggregate types.

The original code is not so bad now that the comments are gone but this is
still a bit cleaner.

No change in the generated code.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: remove comment support from IDL
Ian Campbell [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: remove comment support from IDL

People typically don't look for comments in generated source and the syntax for
specifying them in the IDL makes things harder to follow.

Instead just use source code comments in the IDL itself.

I dropped a bunch of "foo bool # enable or disable foo" type comments. A lot of
the remainder still aren't terribly useful though.

No change to the generate code other than the comments being removed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: do not write/maintain "pool_name" in XenStore
Ian Campbell [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: do not write/maintain "pool_name" in XenStore

Nothing that I can find ever reads this key.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: juergen.gross@ts.fujitsu.com
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: name libxl_create_cpupool consistent with other functions.
Ian Campbell [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: name libxl_create_cpupool consistent with other functions.

The pattern for the other cpupool functions is libxl_cpupool_<ACTION>
and in general we use libxl_<THING>_<ACTION>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: juergen.gross@ts.fujitsu.com
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: remove libxl_domain_create_info.poolname
Ian Campbell [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: remove libxl_domain_create_info.poolname

It is redundant with poolid and allowing the user to specify both
opens up the possibility of a disconnect.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: juergen.gross@ts.fujitsu.com
[since v2 - correct default is 0 not -1]
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agox86: Use defines for bits of MSR_IA32_DEBUGCTLMSR instead of numbers
Dietmar Hahn [Wed, 1 Feb 2012 15:45:54 +0000 (16:45 +0100)]
x86: Use defines for bits of MSR_IA32_DEBUGCTLMSR instead of numbers

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agolibxl: add support for yajl 2.x
Roger Pau Monne [Tue, 31 Jan 2012 16:48:06 +0000 (16:48 +0000)]
libxl: add support for yajl 2.x

This patch adds support for yajl versions 2.x, while retaining 1.x
compatibility. All the needed ifdefs can be found in libxl_json.h.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agomini-os: use BSD sys/queue.h instead of Linux list.h
Ian Campbell [Tue, 31 Jan 2012 16:06:14 +0000 (16:06 +0000)]
mini-os: use BSD sys/queue.h instead of Linux list.h

The latter is GPL which makes the whole of mini-os GPL rather than BSD
as intended. In tree users are all GPL or GPL-compatible but we should
fix this so that mini-os is BSD. Do so by using the same BSD
sys/queue.h as we use in libxl.

Tested with the builtin mini-os test app and qemu stubdomain, both of which
appear to still function as expected.

Move tools/libxl/external and the associated sed script to
tools/include/xen-external to allow more sensible access from mini-os.

Also add s/NULL/0/ in the sed script due to NULL not always being
defined in stubdom code when mini-os/wait.h is included.

As well as the obvious ABI changes there are a few API updates
associated with the change:

  - struct rw_semaphore.wait_list is unused
  - remove_waiter needs to take the wait_queue_head

The latter requires a qemu update, so there is also a QEMU_TAG
update in this changeset.

I sprinkled some extra-emacs local variables around the files I edited
which didn't have them.

I think this should be backported to the stable branches since
external users of mini-os may have been mislead into thinking they
could safely link mini-os against GPL-incompatible code.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxen: do not remap pirqs if !is_hvm_pv_evtchn_domain
Stefano Stabellini [Tue, 31 Jan 2012 11:39:37 +0000 (11:39 +0000)]
xen: do not remap pirqs if !is_hvm_pv_evtchn_domain

If the guest is an HVM guest and it is not using the vector callback
mechanism, refuse to remap pirqs onto event channels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Paulian Bogdan Marinca <paulian@marinca.net>
Committed-by: Keir Fraser <keir@xen.org>
14 years agopublic/physdev.h: Fix __XEN_INTERFACE_VERSION__ typo.
Keir Fraser [Tue, 31 Jan 2012 11:37:03 +0000 (11:37 +0000)]
public/physdev.h: Fix __XEN_INTERFACE_VERSION__ typo.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agotools/libxc: remove volatile keyword for bitmap operations
Olaf Hering [Tue, 31 Jan 2012 11:35:07 +0000 (11:35 +0000)]
tools/libxc: remove volatile keyword for bitmap operations

All bitmaps maintained by xc_bitops.h are used in single threaded
applications. So nothing will change the bitmaps content, adding
volatile adds just unneeded memory reloads.

xenpaging uses bitmaps alot and using non-volatile versions will
slightly improve performance.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
14 years agotools/libxc: fix bitmap_alloc usage in xc_ia64_send_vcpumap
Olaf Hering [Tue, 31 Jan 2012 11:34:43 +0000 (11:34 +0000)]
tools/libxc: fix bitmap_alloc usage in xc_ia64_send_vcpumap

Changeset 23577:607474aeefe1 introduced an error in
xc_ia64_send_vcpumap(), bitmap_alloc() was not used correctly.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
14 years agomini-os: convert mlock macros to C functions
Olaf Hering [Tue, 31 Jan 2012 11:33:35 +0000 (11:33 +0000)]
mini-os: convert mlock macros to C functions

mlock and munlock are implemented as macros in mini-os. Their usage
requires casting in common code.  Convert them to C syntax and provide
an empty dummy function.  Remove the now unneeded (void) cast from two
munlock calls.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agoxenpaging: unify return value in nominate and evict
Olaf Hering [Mon, 30 Jan 2012 12:06:34 +0000 (13:06 +0100)]
xenpaging: unify return value in nominate and evict

Let p2m_mem_paging_nominate and p2m_mem_paging_evict return just one
error number. EINVAL is not very helpful in case of nominate, it can
happen if the pager tries to nominate a ballooned page. In this case the
gfn is not backed by a mfn, the pager can not know that.  Similar with
evict, anything can happen between nominate and evict.

This change helps the pager to decide if the returned error is from the
function itself, or if it happend earlier. In the latter case, it is
most likely fatal and should be handled as such.
nominate and evict return EBUSY, which is supposed to mean
"pager request reached target function, and failed."

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agolibxl: treat "dying" domains as destroyed
Ian Jackson [Mon, 30 Jan 2012 15:23:39 +0000 (15:23 +0000)]
libxl: treat "dying" domains as destroyed

Rename the DOMAIN_DESTROY event to DOMAIN_DEATH and have it trigger
when the domain goes into the state indicated by the domaininfo flag
"dying".

This fixes a race which could leak a daemonised xl process, which
would have ignored the domain becoming "dying" and would then wait
forever to be told the domain was destroyed.

After the domain becomes "dying" we can't generate an event when it is
actually destroyed because xenstored will eat the relevant
VIRT_DOM_EXC virq and not generate an @releaseDomain, since xenstored
discards its own record of the domain's existence as soon as it sees
the domain "dying" and will not trigger @releaseDomain watches for
domains it knows nothing about.  Arguably this is a bug in xenstored,
and the whole @releaseDomain machinery is rather poor, but let us not
fix that now.

Anyway, xl does not really want to know when the domain is ultimately
destroyed.  It is enough for xl to know that it is on the way out, in
the "dying" state (which leads later to destruction by Xen).

Also fix a bug where domain_death_xswatch_callback might read one
domain beyond the valid data in its domaininfos array, by correctly
ordering the checks for empty domain list, end of domain list, and our
domain being missing.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: domain_death_xswatch_callback: add some debug logging
Ian Jackson [Mon, 30 Jan 2012 15:23:38 +0000 (15:23 +0000)]
libxl: domain_death_xswatch_callback: add some debug logging

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxen: Preserve reserved grant entries when switching versions
Daniel De Graaf [Sat, 28 Jan 2012 13:49:41 +0000 (13:49 +0000)]
xen: Preserve reserved grant entries when switching versions

In order for the toolstack to use reserved grant table entries, the
grant table for a guest must be initialized prior to the guest's boot.
When the guest switches grant table versions (necessary if the guest
is using v2 grant tables, or on kexec if switching grant versions),
these initial grants will be cleared. Instead of clearing them,
preserve the grants across the type change.

Attempting to preserve v2-only features such as sub-page grants will
produce a warning and clear the resulting v1 grant entry.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: use XSM instead of IS_PRIV for getdomaininfo
Daniel De Graaf [Sat, 28 Jan 2012 13:49:05 +0000 (13:49 +0000)]
xen: use XSM instead of IS_PRIV for getdomaininfo

The XEN_DOMCTL_getdomaininfo domctl does not allow manipulation of
domains, only basic information such as size and state, so its use
does not fully justify making a domain privileged. XSM modules can
also provide fine-grained control over what domains are visible to
domains that call getdomaininfo.

If XSM is disabled (either at compile time or by using the dummy XSM
module) then there is no change in behavior: only IS_PRIV domains can
use this domctl. If enabled, the XSM module controls access.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: change virq parameters from int to uint32_t
Daniel De Graaf [Sat, 28 Jan 2012 13:48:34 +0000 (13:48 +0000)]
xen: change virq parameters from int to uint32_t

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: allow global VIRQ handlers to be delegated to other domains
Daniel De Graaf [Sat, 28 Jan 2012 13:48:03 +0000 (13:48 +0000)]
xen: allow global VIRQ handlers to be delegated to other domains

This patch sends global VIRQs to a domain designated as the VIRQ
handler
instead of sending all global VIRQ events to dom0. This is required in
order to run xenstored in a stubdom, because VIRQ_DOM_EXC must be sent
to xenstored for domain destruction to work properly.

This patch was inspired by the xenstored stubdomain patch series sent
to xen-devel by Alex Zeffertt in 2009.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: reinstate previously unused XENMEM_remove_from_physmap hypercall
Daniel De Graaf [Sat, 28 Jan 2012 13:47:24 +0000 (13:47 +0000)]
xen: reinstate previously unused XENMEM_remove_from_physmap hypercall

This patch reinstates the XENMEM_remove_from_physmap hypercall
which was removed in 19041:ee62aaafff46 because it was not used.

However, is now needed in order to support xenstored stub domains.
The xenstored stub domain is not priviliged like dom0 and so cannot
unilaterally map the xenbus page of other guests into it's address
space.  Therefore, before creating a domU the domain builder needs to
seed its grant table with a grant ref allowing the xenstored stub
domain to access the new domU's xenbus page.

At present domU's do not start with their grant table mapped.
Instead it gets mapped when the guest requests a grant table from
the hypervisor.

In order to seed the grant table, the domain builder first needs to
map it into dom0 address space.  But the hypercall to do this
requires a gpfn (guest pfn), which is an mfn for PV guest, but a pfn
for HVM guests.  Therfore, in order to seed the grant table of an
HVM guest, dom0 needs to *temporarily* map it into the guest's
"physical" address space.

Hence the need to reinstate the XENMEM_remove_from_physmap hypercall.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2
Stefano Stabellini [Sat, 28 Jan 2012 13:45:13 +0000 (13:45 +0000)]
xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2

PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
In order to improve the interface this patch:

- renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;

- introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
  PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
  another hypercall;

- bump __XEN_LATEST_INTERFACE_VERSION__;

- #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1 or
  PHYSDEVOP_pirq_eoi_gmfn_v2 depending on the __XEN_INTERFACE_VERSION.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agovesa: flush lfb after zeroing
Andrew Cooper [Sat, 28 Jan 2012 13:42:25 +0000 (13:42 +0000)]
vesa: flush lfb after zeroing

If Xen is going to relinquish the VGA console, flush the linear frame
buffer after zeroing it in vesa_endboot().

Failing to do so in some circumstances leads to the actual linear
framebuffer on the graphics card still containing the output of the
Xen boot console can lead to ugly graphics output when dom0 is setting
up the graphics card for its own use.

While the patch is quite large, it is mostly just code motion to
prevent having to forward declare lfb_flush().  The only functional
change to vesa_endboot() is to insert a call to lbf_flush().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoConsole: introduce console=none command line parameter
Andrew Cooper [Sat, 28 Jan 2012 13:41:42 +0000 (13:41 +0000)]
Console: introduce console=none command line parameter

Currenty, not specifying 'console=<foo>' on the command line causes
Xen to default to 'vga'.  Alternativly, the user can explicitly
specifiy 'console=vga|com1|com2'.

However, there is no way to specify that neither vga nor serial should
be used.  Specifying 'console=' does have the effect that neither vga
nor serial is set up, but at the cost of an "Bad console= option ''"
warning.

Therefore, expliticly support a 'console=none' option which does not
set up vga and does not set up serial, but does not trigger the bad
console warning.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoamd iommu: disable iommu emulation on non-iommu systems
Wei Wang [Sat, 28 Jan 2012 13:40:36 +0000 (13:40 +0000)]
amd iommu: disable iommu emulation on non-iommu systems

Introduce a new flag to disable iommu emulation on old iommu systems.
This patch is taken from my v4 patch queue, which is till pending, to
make old or non-iommu system to run cleanly without interfered by
iommuv2 codes. This might be helpful to isolate iommuv2 code in
debugging unstable regressions. The reset part of v4 will be re-based.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agolibxl: allow for specifying the CPU affinity in the config file.
Dario Faggioli [Fri, 27 Jan 2012 19:17:03 +0000 (19:17 +0000)]
libxl: allow for specifying the CPU affinity in the config file.

Enable CPU affinity specification in a VM's config file with the
exact syntax `xl vcpu-pin' provides.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: extend pCPUs specification for vcpu-pin.
Dario Faggioli [Fri, 27 Jan 2012 19:14:00 +0000 (19:14 +0000)]
libxl: extend pCPUs specification for vcpu-pin.

Allow for "^<cpuid>" syntax while specifying the pCPUs list
during a vcpu-pin. This enables doing the following:

 xl vcpu-pin 1 1 0-4,^2

and achieving:

 xl vcpu-list
 Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
 ...
 Squeeze_pv                           1     1    3   -b-       2.4  0-1,3-4
 ...

Negative ranges are also supported, such as "0-4,^1-2" to
mean "0,3-4"

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxenpaging: make file_op largefile aware
Olaf Hering [Fri, 27 Jan 2012 19:03:37 +0000 (19:03 +0000)]
xenpaging: make file_op largefile aware

lseek() takes an off_t, the used "int << shiftsize" does not automatically
convert the int into a larger type. This leads to write errors with pagefiles
larger than 2G. Fix this by shifting an off_t instead of an int.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly
Olaf Hering [Fri, 27 Jan 2012 18:32:55 +0000 (18:32 +0000)]
tools/libxc: handle fallback in linux_privcmd_map_foreign_bulk properly

If the first ioctl fails with ENOENT it means the command is known. If a
second attempt to map each gfn happens to fail then there is no need to
run the fallback code. Some gfns are paged and the fallback code would
not fix the failure. Instead return the EINVAL to the caller.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: memshrtool: tool to test and exercise the sharing subsystem
Andres Lagar-Cavilla [Fri, 27 Jan 2012 18:23:42 +0000 (18:23 +0000)]
tools: memshrtool: tool to test and exercise the sharing subsystem

This is demo code meant to showcase how to perform sharing
operations. It is useful for testing.

[ Added appropriate lines to .hgignore and .gitignore -iwj ]

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl_qmp: fix qmp_next to cope with multiple lines read in a single buffer
Stefano Stabellini [Fri, 27 Jan 2012 17:58:20 +0000 (17:58 +0000)]
libxl_qmp: fix qmp_next to cope with multiple lines read in a single buffer

qmp_next doesn't handle multiple lines read together in a single
buffer correctly at the moment.  This patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix mutex initialization
Roger Pau Monne [Fri, 27 Jan 2012 17:48:14 +0000 (17:48 +0000)]
libxl: fix mutex initialization

The macro PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined on
NetBSD, so define mutex attributes manually.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix upstream qemu binary name to what we actually install
Ian Campbell [Fri, 27 Jan 2012 17:09:04 +0000 (17:09 +0000)]
libxl: fix upstream qemu binary name to what we actually install

Binary is always qemu-system-i386 even for a 64 bit build.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Convert to asynchronous: device removal
Ian Jackson [Fri, 27 Jan 2012 17:01:26 +0000 (17:01 +0000)]
libxl: Convert to asynchronous: device removal

Convert libxl_FOO_device_remove, and the function which does the bulk
of the work, libxl__device_remove, to the new async ops scheme.

Adjust all callers.

Also remove libxl__wait_for_device_state which is now obsolete.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: Introduce libxl__ev_devstate
Ian Jackson [Fri, 27 Jan 2012 17:01:25 +0000 (17:01 +0000)]
libxl: Introduce libxl__ev_devstate

Provide a new-style asynchronous facility for waiting for device
states on xenbus.  This will replace libxl__wait_for_device_state,
after the callers have been updated in later patches.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: New convenience macro CONTAINER_OF
Ian Jackson [Fri, 27 Jan 2012 17:01:24 +0000 (17:01 +0000)]
libxl: New convenience macro CONTAINER_OF

Provide a convenient and type-safe wrapper which does the correct
dance to subtract offsetof.  This is very similar to the
"container_of" macro in the Linux kernel, but it has an additional
feature that instead of the type argument you may also pass an
expression of that type; this makes initialising a variable with
CONTAINER_OF easier.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: Asynchronous/long-running operation infrastructure
Ian Jackson [Fri, 27 Jan 2012 17:01:24 +0000 (17:01 +0000)]
libxl: Asynchronous/long-running operation infrastructure

Provide a new set of machinery for writing public libxl functions
which may take a long time.  The application gets to decide whether
they want the function to be synchronous, or whether they'd prefer to
get a callback, or an event, when the operation is complete.

User(s) of this machinery will be introduced in later patch(es).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: Permit multithreaded event waiting
Ian Jackson [Fri, 27 Jan 2012 17:01:23 +0000 (17:01 +0000)]
libxl: Permit multithreaded event waiting

Previously, the context would be locked whenever we were waiting in
libxl's own call to poll (waiting for operating system events).

This would mean that multiple simultaneous calls to libxl_event_wait
in different threads with different parameters would not work
properly.

If we simply unlock the context, it would be possible for another
thread to discover the occurrence of the event we were waiting for,
without us even waking up, and we would remain in poll.  So we need a
way to wake up other threads: a pipe, one for each thread in poll.

We also need to move some variables from globals in the ctx to be
per-polling-thread.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: introduce libxl_fd_set_nonblock, rationalise _cloexec
Ian Jackson [Fri, 27 Jan 2012 17:01:23 +0000 (17:01 +0000)]
libxl: introduce libxl_fd_set_nonblock, rationalise _cloexec

We want a function for setting fds to nonblocking, so introduce one.

This is a very similar requirement to that for libxl_fd_set_cloexec,
so make it common with that.

While we're at it, fix a few deficiences that make this latter
function less desirable than it could be:
 * Change the return from 0/-1 (like a syscall) to a libxl error code
 * Take a boolean parameter for turning the flag on and off
 * Log on error (and so, take a ctx for this purpose)

Change callers of libxl_fd_set_cloexec to notice errors.  (Although,
such errors are highly unlikely.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: New event generation API
Ian Jackson [Fri, 27 Jan 2012 17:01:22 +0000 (17:01 +0000)]
libxl: New event generation API

Replace the existing API for retrieving high-level events (events
about domains, etc.) from libxl with a new one.

This changes the definition and semantics of the `libxl_event'
structure, and replaces the calls for obtaining information about
domain death and disk eject events.

This is an incompatible change, sorry.  The alternative was to try to
provide both the previous horrid API and the new one, and would also
involve never using the name `libxl_event' for the new interface.

The new "libxl_event" structure is blacklisted in the ocaml bindings
for two reasons:
  - It has a field name "type" (which is a keyword in ocaml);
    the ocaml idl generator should massage this field name on
    output, to "type_" perhaps.
  - The ocaml idl generator does not support KeyedUnion.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoocaml, libxl: support "private" fields
Ian Jackson [Fri, 27 Jan 2012 17:01:21 +0000 (17:01 +0000)]
ocaml, libxl: support "private" fields

The changeset
  24378:b4365e2c2595  libxl: idl: support new "private" type attribute
is not complete.  Actually using this feature does not work because
the ocaml idl generator does not know about it.

So add that support.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: New API for providing OS events to libxl
Ian Jackson [Fri, 27 Jan 2012 17:01:20 +0000 (17:01 +0000)]
libxl: New API for providing OS events to libxl

We provide a new set of functions and related structures
  libxl_osevent_*
which are to be used by event-driven applications to receive
information from libxl about which fds libxl is interested in, and
what timeouts libxl is waiting for, and to pass back to libxl
information about which fds are readable/writeable etc., and which
timeouts have occurred.  Ie, low-level events.

In this patch, this new machinery is still all unused.  Callers will
appear in the next patch in the series, which introduces a new API for
applications to receive high-level events about actual domains etc.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxl: fix a couple of memory leaks
Ian Jackson [Fri, 27 Jan 2012 17:01:19 +0000 (17:01 +0000)]
xl: fix a couple of memory leaks

* dolog leaked the log message (!)

* main() leaked the config_data (perhaps a false positive from valgrind,
  but it's nicer to tidy it up).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years ago.gitignore/.hgignore: New names for ioemu dirs, seabios
Ian Jackson [Fri, 27 Jan 2012 17:01:18 +0000 (17:01 +0000)]
.gitignore/.hgignore: New names for ioemu dirs, seabios

* Add new seabios clone directories to .gitignore.
* Add new qemu clone directories to .gitignore.
* Remove old tools/ioemu (long-obsolete) from .gitignore and .hgignore.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agotools: xencommons init script: Fix setting XENSTORED_ROOTDIR
Jim Fehlig [Thu, 26 Jan 2012 17:43:31 +0000 (17:43 +0000)]
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix parse_backend_path and device_backend_path to be mutual
Roger Pau Monne [Thu, 26 Jan 2012 17:38:05 +0000 (17:38 +0000)]
libxl: fix parse_backend_path and device_backend_path to be mutual

Currently if libxl__parse_backend_path is used and then you try to get
the original path again with libxl__device_backend_path the
result is wrong. This patch fixes the issue, so transformation from
path to libxl__device and back is reciprocal.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoGet rid of non-static 'inline' modifiers (gcc 4.2.1 complains)
Tim Deegan [Thu, 26 Jan 2012 15:42:40 +0000 (15:42 +0000)]
Get rid of non-static 'inline' modifiers (gcc 4.2.1 complains)

They seem to have been introduced by accident in 23311:f4585056b9ae
when some 'static inline' functions were moved out of a header

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agoBring OpenBSD stdarg handling in line with FreeBSD case
Tim Deegan [Thu, 26 Jan 2012 15:35:36 +0000 (15:35 +0000)]
Bring OpenBSD stdarg handling in line with FreeBSD case

Having an absolute path in a #include confuses distcc's pump mode
so get rid ofit by using the same runes for both BSDs.

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agoFix build.
Tim Deegan [Thu, 26 Jan 2012 15:05:15 +0000 (15:05 +0000)]
Fix build.

Bring xc_mem_paging.c in line with other users of munlock in libxc.
Otherwise it trips over -Werror=unused-value

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Avoid spurious deadlock panic trigger
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Avoid spurious deadlock panic trigger

In the mm layer, if we take lock A, then lock B, and the recursively lock A,
the deadlock detector panics. This is not a deadlock risk because we
already 'own' the outer lock (A), so we will not contend for that resource.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: clean use of p2m unlocked queries
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: clean use of p2m unlocked queries

Limit such queries only to p2m_query types. This is more compatible
with the name and intended semantics: perform only a lookup, and explicitly
in an unlocked way.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Properly account for paged out pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Properly account for paged out pages

If we hit the page after nominate but before paging it out, don't decrement the
domain count of paged out pages.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Remove stale variable from debugtrace printk in p2m audit
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Remove stale variable from debugtrace printk in p2m audit

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Output domain count of paged pages in console
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Output domain count of paged pages in console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Allow foreign read-only mappings of shared pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Allow foreign read-only mappings of shared pages

Because shared pages are owned by dom_cow, the ownership test
while foreign mapping fails.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Fix p2m teardown locking
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Fix p2m teardown locking

Holding the p2m lock during a p2m teardown, while unsharing entries pointing to
shared frames, causes a locking inversion and deadlock panic.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Fix paging_load
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Fix paging_load

When restoring a p2m entry in the paging_load path, we were not updating the
m2p entry correctly.

Also take advantage of this to act on an old suggestion: once done with the
load, promote the p2m entry to the final guest accessible type. This simplifies
logic.

Tested to work with xenpaging.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Sharing overhaul style improvements
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Sharing overhaul style improvements

The name 'shared_info' for the list of shared pages backed by a share frame
collided with the identifier also used for a domain's shared info page. To
avoid grep/cscope/etc aliasing, rename the shared memory token to 'sharing.

This patch only addresses style, and performs no functional changes. To ease
reviwing, the patch was left as a stand-alone last-slot addition to the queue
to avoid propagating changes throughout the whole series.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoTools: Add a sharing command to xl for information about shared pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Tools: Add a sharing command to xl for information about shared pages

Also add the global sharing statistics to the libxl physinfo.  This is a slight
departure from libxc, but there's no reason libxl physinfo can't include extra
bits of useful and relevant information.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoTools: Expose to libxc the total number of shared frames and space saved
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Tools: Expose to libxc the total number of shared frames and space saved

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoUpdate memshr API and tools
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Update memshr API and tools

This patch is the folded version of API updates, along with the associated tool
changes to ensure that the build is always consistent.

API updates:
- The source domain in the sharing calls is no longer assumed to be dom0.
- Previously, the mem sharing code would return an opaque handle to index
  shared pages (and nominees) in its global hash table.  By removing the hash
  table, the handle becomes a version, to avoid sharing a stale version of a
  page. Thus, libxc wrappers and tools need to be updated to recall the share
  functions with the information needed to fetch the page (which they readily
  have).

Tool updates:
The only (in-tree, that we know of) consumer of the mem sharing API is the
memshr tool. This is updated to use the new API.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: use RCU in mem sharing audit list, eliminate global lock completely
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: use RCU in mem sharing audit list, eliminate global lock completely

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoAdd the ability to poll stats about shared memory via the console
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Add the ability to poll stats about shared memory via the console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: New domctl: add a shared page to the physmap
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: New domctl: add a shared page to the physmap

This domctl is useful to, for example, populate parts of a domain's physmap
with shared frames, directly.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Check how many mfns are shared, in addition to how many are saved
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Check how many mfns are shared, in addition to how many are saved

This patch also moves the existing sharing-related memory op to the
correct location, and adds logic to the audit() method that uses the
new information.

This patch only provides the Xen implementation of the domctls.

Signed-off-by: Andres Lagar-Cavilla <andres@scannell.ca>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Enforce lock ordering for sharing page locks
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Enforce lock ordering for sharing page locks

Use the ordering constructs in mm-locks.h to enforce an order
for the p2m and page locks in the sharing code. Applies to either
the global sharing lock (in audit mode) or the per page locks.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scanneell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Add per-page locking for memory sharing, when audits are disabled
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Add per-page locking for memory sharing, when audits are disabled

With the removal of the hash table, all that is needed now is locking
of individual shared pages, as new (gfn,domain) pairs are removed or
added from the list of mappings.

We recycle PGT_locked and use it to lock individual pages. We ensure deadlock
is averted by locking pages in increasing order.

The global lock remains for the benefit of the auditing code, and is
thus enabled only as a compile-time option.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Update mem sharing interface to (re)allow sharing of grants
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Update mem sharing interface to (re)allow sharing of grants

Previously, the mem sharing code would return an opaque handle to index shared
pages (and nominees) in its global hash table.  By removing the hash table, the
new interfaces requires a gfn and a version. However, when sharing grants, the
caller provides a grant ref and a version. Update interface to handle this
case.

The use case for grant sharing is when sharing from within a backend (e.g.
memshr + blktap2), in which case the backend is only exposed to grant
references.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Committed-by: Tim Deegan <tim@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Eliminate hash table in sharing code as index of shared mfns
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Eliminate hash table in sharing code as index of shared mfns

Eliminate the sharing hastable mechanism by storing a list head directly in the
page info for the case when the page is shared.  This does not add any extra
space to the page_info and serves to remove significant complexity from
sharing.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoseabios: update to 1.6.3.1 release
Ian Campbell [Thu, 26 Jan 2012 11:06:40 +0000 (11:06 +0000)]
seabios: update to 1.6.3.1 release

This is the latest seabios stable release.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoREADME: add upstream qemu dependecies
Stefano Stabellini [Thu, 26 Jan 2012 11:06:06 +0000 (11:06 +0000)]
README: add upstream qemu dependecies

Upstream Qemu, just added to the Xen build system, needs GLib 2.0 and
pkg-config to compile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agotools/libxc: fix error handling in xc_mem_paging_load
Olaf Hering [Thu, 26 Jan 2012 11:04:59 +0000 (11:04 +0000)]
tools/libxc: fix error handling in xc_mem_paging_load

xc_mem_paging_load() does not pass errors in errno and the actual
errno from xc_mem_event_control() is overwritten by munlock().
xenpaging_populate_page() needs to check errno, but with the switch to
xc_mem_paging_load() it could not receive ENOMEM anymore.

Update xc_mem_paging_load() to return -1 and preserve errno during
munlock().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Make the escape code consistent across 32 and 64-bit xen
George Dunlap [Thu, 26 Jan 2012 11:03:50 +0000 (11:03 +0000)]
xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Use uint64_t explicitly for internal calls
George Dunlap [Thu, 26 Jan 2012 11:03:23 +0000 (11:03 +0000)]
xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agodocs: Remove outdated LaTex documentation.
Keir Fraser [Wed, 25 Jan 2012 15:52:47 +0000 (15:52 +0000)]
docs: Remove outdated LaTex documentation.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoSVM: Plumb NPT error-code bits into nested-fault access_X arguments.
Tim Deegan [Tue, 24 Jan 2012 16:46:17 +0000 (16:46 +0000)]
SVM: Plumb NPT error-code bits into nested-fault access_X arguments.

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agolibxl: rename is_assigned to is_pcidev_in_array
Doug Magee [Tue, 24 Jan 2012 15:36:19 +0000 (15:36 +0000)]
libxl: rename is_assigned to is_pcidev_in_array

All this function does is check to see if a device is in an array of
pcidevs passed by the caller.  The function name can be misleading if
ever used to check against a list of devices other than those assigned
to a domain.

Signed-off-by: Doug Magee <djmagee@mageenet.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: Add missing trigger for the xl trigger cmd.
Jean Guyader [Tue, 24 Jan 2012 15:33:36 +0000 (15:33 +0000)]
xl: Add missing trigger for the xl trigger cmd.

Add s3resume trigger in the usage of the xl trigger cmd.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove _libxl_json_internal.h from libxl_json.h
Ian Campbell [Tue, 24 Jan 2012 15:30:46 +0000 (15:30 +0000)]
libxl: remove _libxl_json_internal.h from libxl_json.h

libxl_json.h is intended as a user-includable header for applications which
would like to use libyajl directly with libxl types. It should not expose libxl
internals.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoupdate MAINTAINERS file
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:32 +0000 (15:09 +0000)]
update MAINTAINERS file

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: use new qemu at the location where xen-unstable installs it
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:31 +0000 (15:09 +0000)]
libxl: use new qemu at the location where xen-unstable installs it

From: Ian Campbell <ian.campbell@citrix.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoClone and build Seabios by default
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:31 +0000 (15:09 +0000)]
Clone and build Seabios by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoClone and build upstream Qemu by default
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:30 +0000 (15:09 +0000)]
Clone and build upstream Qemu by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agomove the call to xen-setup after libxc and xenstore are built
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:30 +0000 (15:09 +0000)]
move the call to xen-setup after libxc and xenstore are built

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Move the call to xen-setup, the wrapper script to configure
qemu-xen-traditional, right before building qemu-xen-traditional and
after libxc and xenstore are already built.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoRename ioemu-dir as qemu-xen-traditional-dir
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:29 +0000 (15:09 +0000)]
Rename ioemu-dir as qemu-xen-traditional-dir

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoIntroduce git-checkout.sh
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:29 +0000 (15:09 +0000)]
Introduce git-checkout.sh

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Introduce a script to perform git checkout on an external git tree; use
git-checkout.sh in ioemu-dir-find.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoreflect cpupool in numa node affinity
Juergen Gross [Tue, 24 Jan 2012 14:21:12 +0000 (14:21 +0000)]
reflect cpupool in numa node affinity

In order to prefer node local memory for a domain the numa node
locality info must be built according to the cpus belonging to the
cpupool of the domain.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agoswitch to dynamically allocated cpumask in domain_update_node_affinity()
Juergen Gross [Tue, 24 Jan 2012 14:20:40 +0000 (14:20 +0000)]
switch to dynamically allocated cpumask in domain_update_node_affinity()

cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agointroduce and use common macros for selecting cpupool based cpumasks
Juergen Gross [Tue, 24 Jan 2012 14:19:58 +0000 (14:19 +0000)]
introduce and use common macros for selecting cpupool based cpumasks

There are several instances of the same construct finding the cpumask
for a cpupool. Use macros instead.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agoAdd a GNTTABOP to swap the content of two grant references under lock
Wei Liu [Tue, 24 Jan 2012 14:16:04 +0000 (14:16 +0000)]
Add a GNTTABOP to swap the content of two grant references under lock
provided that they are not currently active.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoRevert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and...
Keir Fraser [Mon, 23 Jan 2012 15:10:43 +0000 (15:10 +0000)]
Revert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and 64-bit xen"

Breaks 32-bit build.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agodecompressors: fix string typo 'bufer'
Paul Bolle [Mon, 23 Jan 2012 13:51:25 +0000 (14:51 +0100)]
decompressors: fix string typo 'bufer'

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agounlzo: fix input buffer free
Sascha Hauer [Mon, 23 Jan 2012 13:51:02 +0000 (14:51 +0100)]
unlzo: fix input buffer free

unlzo modifies the pointer to in_buf, so we have to free the original
buffer, not the modified pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agolibelf-loader: introduce elf_load_image
Stefano Stabellini [Mon, 23 Jan 2012 09:42:12 +0000 (09:42 +0000)]
libelf-loader: introduce elf_load_image

Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding.  The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoIntroduce clear_user and clear_guest
Stefano Stabellini [Mon, 23 Jan 2012 09:41:27 +0000 (09:41 +0000)]
Introduce clear_user and clear_guest

Introduce clear_user for x86 and ia64, shamelessly taken from Linux.
The x86 version is the 32 bit clear_user implementation.  Introduce
clear_guest for x86 and ia64. The x86 implementation is based on
clear_user and a new clear_user_hvm function.  The ia64 implementation
is actually in xencomm and it is based on xencomm_copy_to_guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>